from selenium import webdriver
from selenium.webdriver.common.by import By
import time

driver = webdriver.Chrome()
driver.maximize_window()

driver.get("https://www.hao123.com/")
# driver.find_element(By.XPATH, "//input[@id='kw']").send_keys("python")
# driver.find_element(By.XPATH, "//input[@id='su']").click()
time.sleep(2)

# 执行页面下拉操作
for i in range(1, 6):
    # js = f"window.scrollTo(0,{i*200})"
    js = f"var q=document.documentElement.scrollTop={i*200}"
    driver.execute_script(js)
    time.sleep(2)

driver.quit()
